<?php
header('Cache-Control:no-cache,must-revalidate');
header('Pragma:no-cache');
header("Expires:0");

//echo $ticket;
?>
<!DOCTYPE html>
<html lang="en">
<script>
    var code="<?php  echo $code; ?>";
    var state="<?php echo $state; ?>";
    var sign="<?php  echo $sign; ?>";
    var ticket="<?php  echo $ticket; ?>"
    localStorage.setItem('code',code);
    localStorage.setItem('ticket',ticket);
    sessionStorage.setItem("path",state);
</script>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/CSS/swiper-3.3.1.min.css"/>
    <link rel="stylesheet" type="text/css" href="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/CSS/common.css"/>
    <link rel="stylesheet" type="text/css" href="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/CSS/photoswipe.css">
    <link rel="stylesheet" type="text/css" href="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/CSS/default-skin/default-skin.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/wx/dist/bundle.css"/>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/photoswipe.min.js"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/photoswipe-ui-default.min.js"></script>
    <script src="https://webapi.amap.com/maps?v=1.3&key=63826ceefa3fd1de6c8c7d72d4c9c12e"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/axios.min.js"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/swiper-3.3.1.min.js"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/vue-router.js"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/vue-router.min.js"></script>
    <script src="https://cdn.bootcss.com/blueimp-md5/1.1.0/js/md5.js"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/ciphertext.js"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/Button/mathjs.js"></script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/resize.min.js"></script>
    <script src="https://www.sobot.com/chat/frame/js/entrance.js?sysNum=8aa3c6e204e843ce93d80c7b9208d4e6"></script>
    <title>砍好货</title>
</head>

<body>
<div id="app"></div>
<script>
    /*jsapi*/
    var link=encodeURIComponent(location.href.split('#')[0]);
    var values=encodeURIComponent(JSON.stringify({"link":link})),
        keys=demo(values);
    axios.get('/Home/wx/GetJSAPI',{
        params:{
            value:values,
            key:keys,
            ticket:localStorage.getItem('ticket')
        }
    })
        .then(function(res) {
            wx.config({
                debug: false,
                appId: res.data.data.appId,
                timestamp: res.data.data.timestamp,
                nonceStr: res.data.data.nonceStr,
                signature: res.data.data.signature,
                jsApiList: [
                    // 所有要调用的 API 都要加到这个列表中
                    'onMenuShareTimeline',
                    'onMenuShareAppMessage',
                    'chooseImage',
                    'previewImage',
                    'uploadImage',
                    'downloadImage',
                    'hideMenuItems',
                    'showMenuItems',
                    'closeWindow',
                    "chooseWXPay",
                    "hideAllNonBaseMenuItem",
                    "hideOptionMenu",
                    "showOptionMenu",
                    "showAllNonBaseMenuItem",
                    "openLocation",
                    "getLocation"
                ]
            });
            localStorage.setItem('ticket',res.data.ticket);
            setTimeout(function () {
                var script1 = document.createElement("script");
                script1.type = "text/javascript";
                script1.src = "https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/JS/common.js";
                document.body.appendChild(script1);
                var script2 = document.createElement("script");
                script2.type = "text/javascript";
                script2.src = "__PUBLIC__/wx/dist/build.js?v=<?php echo rand(1000,50000)?>";
                document.body.appendChild(script2);
            },0)
        }.bind(this))
        .catch(function (error) {
            console.log(error);
        });

</script>
<script>
    setTimeout(function(){
        var navH=document.getElementById('nav').offsetHeight;
        window.onscroll=function(){
            if(window.scrollY>=0){
                document.getElementById('nav').style.position='fixed'
            }else{
                document.getElementById('nav').style.position='absolute'
            }
        }

    },300)
</script>
</body>
</html>
